<?php

namespace App\Repositories;

use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Repositories\StaffPeriodFeeRepository;
use App\Models\StaffPeriodFee;
use App\Validators\StaffPeriodFeeValidator;

/**
 * Class StaffPeriodFeeRepositoryEloquent.
 *
 * @package namespace App\Repositories;
 */
class StaffPeriodFeeRepositoryEloquent extends BaseRepository implements StaffPeriodFeeRepository
{
    /**
     * Specify Model class name
     *
     * @return string
     */
    public function model()
    {
        return StaffPeriodFee::class;
    }

    /**
    * Specify Validator class name
    *
    * @return mixed
    */
    public function validator()
    {

        return StaffPeriodFeeValidator::class;
    }


    /**
     * Boot up the repository, pushing criteria
     */
    public function boot()
    {
        $this->pushCriteria(app(RequestCriteria::class));
    }

    protected $fieldSearchable=[
        'staff.name'=>'like',
        'staff.card_num',
        'staff.id_card',
        'period_id',
        'staffPeriodFeeDetails.dorm.code'
    ];
}
